.switch {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2196f3;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  z-index: 0;
  overflow: hidden;
}

.sun-moon {
  position: absolute;
  content: "";
  height: 10px;
  width: 10px;
  left: 3px;
  bottom: 3px;
  background-color: yellow;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: black;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196f3;
}

input:checked + .slider .sun-moon {
  -webkit-transform: translateX(12px);
  -ms-transform: translateX(12px);
  transform: translateX(12px);
  background-color: white;
  -webkit-animation: rotate-center 0.6s ease-in-out both;
  animation: rotate-center 0.6s ease-in-out both;
}

.moon-dot {
  opacity: 0;
  transition: 0.4s;
  fill: gray;
}

input:checked + .slider .sun-moon .moon-dot {
  opacity: 1;
}

.slider.round {
  border-radius: 34px;
}

.slider.round .sun-moon {
  border-radius: 50%;
}

#moon-dot-1 {
  left: 5px;
  top: 2px;
  position: absolute;
  width: 3px;
  height: 3px;
  z-index: 4;
}

#moon-dot-2 {
  left: 2px;
  top: 5px;
  position: absolute;
  width: 5px;
  height: 5px;
  z-index: 4;
}

#moon-dot-3 {
  left: 8px;
  top: 8px;
  position: absolute;
  width: 2px;
  height: 2px;
  z-index: 4;
}

#light-ray-1 {
  left: -4px;
  top: -4px;
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: -1;
  fill: white;
  opacity: 10%;
}

#light-ray-2 {
  left: -50%;
  top: -50%;
  position: absolute;
  width: 24px;
  height: 24px;
  z-index: -1;
  fill: white;
  opacity: 10%;
}

#light-ray-3 {
  left: -8px;
  top: -8px;
  position: absolute;
  width: 28px;
  height: 28px;
  z-index: -1;
  fill: white;
  opacity: 10%;
}

.cloud-light {
  position: absolute;
  fill: #eee;
  animation-name: cloud-move;
  animation-duration: 6s;
  animation-iteration-count: infinite;
}

.cloud-dark {
  position: absolute;
  fill: #ccc;
  animation-name: cloud-move;
  animation-duration: 6s;
  animation-iteration-count: infinite;
  animation-delay: 1s;
}

#cloud-1 {
  left: 16px;
  top: 8px;
  width: 20px;
}

#cloud-2 {
  left: 22px;
  top: 5px;
  width: 10px;
}

#cloud-3 {
  left: 10px;
  top: 12px;
  width: 15px;
}

#cloud-4 {
  left: 18px;
  top: 10px;
  width: 20px;
}

#cloud-5 {
  left: 24px;
  top: 7px;
  width: 10px;
}

#cloud-6 {
  left: 12px;
  top: 13px;
  width: 15px;
}

@keyframes cloud-move {
  0% {
    transform: translateX(0px);
  }
  40% {
    transform: translateX(4px);
  }
  80% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0px);
  }
}

.stars {
  transform: translateY(-32px);
  opacity: 0;
  transition: 0.4s;
}

.star {
  fill: white;
  position: absolute;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  animation-name: star-twinkle;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

input:checked + .slider .stars {
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
  opacity: 1;
}

#star-1 {
  width: 10px;
  top: 1px;
  left: 2px;
  animation-delay: 0.3s;
}

#star-2 {
  width: 3px;
  top: 8px;
  left: 2px;
}

#star-3 {
  width: 6px;
  top: 10px;
  left: 5px;
  animation-delay: 0.6s;
}

#star-4 {
  width: 9px;
  top: 0px;
  left: 9px;
  animation-delay: 1.3s;
}

@keyframes star-twinkle {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.2);
  }
  80% {
    transform: scale(0.8);
  }
  100% {
    transform: scale(1);
  }
} 